<?php $this->load->view('admin/public/head.html', array('css' => array(
'/assets/admin/css/admin/common.css'
))); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper" ng-controller="admin-user-edit">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            用户管理
            <small>添加用户信息</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="/farm/base/index"><i class="fa fa-dashboard"></i> 用户管理</a></li>
            <li class="active">添加用户</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row adminBase">
            <div class="col-md-12">
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">用户信息</h3>
                    </div>
                    <form class="form-horizontal">
                        <div class="box-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">头像<span class="text-red">*</span></label>
                                <div class="col-sm-6">
                                    <div class="thumb-base-box" style="width: 119px; height: 120px;">
                                        <img style="width: 120px; height: 120px;" ng-show="thumbView" ng-src="{{ thumbView ? thumbView : '' }}" alt="">
                                    </div>
                                    <button class="btn btn-info" style="background: #00a65a; border: none;" id="uploadImage">选择图片</button>
                                    <p class="help-block">支持格式: PNG/JPG/GIF</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="nickName" class="col-sm-2 control-label">昵称</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" ng-model="detail.nickname" id="nickName" placeholder="昵称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">邮箱账号<span class="text-red">*</span></label>
                                <div class="col-sm-5">
                                    <input type="email" class="form-control" ng-model="detail.email" id="email" placeholder="邮箱账号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="password" class="col-sm-2 control-label">登录密码<span class="text-red">*</span></label>
                                <div class="col-sm-5">
                                    <input type="password" class="form-control" ng-model="detail.password" id="password" placeholder="登录密码">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="phone" class="col-sm-2 control-label">手机</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" id="phone" ng-model="detail.phone" placeholder="手机号码">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">角色</label>
                                <div class="col-sm-5">
                                    <div class="btn-group">
                                        <button type="button" class="btn btn-default btn-flat" ng-bind="detail.role ? detail.role : roles[0]['name']"></button>
                                        <button type="button" class="btn btn-default btn-flat dropdown-toggle" data-toggle="dropdown">
                                            <span class="caret"></span>
                                            <span class="sr-only">Toggle Dropdown</span>
                                        </button>
                                        <ul class="dropdown-menu" role="menu">
                                            <li ng-repeat="(key, role) in roles"><a ng-click="selectRole(key)" ng-bind="role.name"></a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <button type="submit" class="btn btn-default btn-sm" onclick="history.go(-1)">返回列表</button>
                            <button type="submit" class="btn btn-info btn-sm pull-right" style="background: #00a65a; border: none;" ng-click="saveAdmin()">确认修改</button>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('admin/public/foot.html', array('js' => array(
'http://cdn.staticfile.org/webuploader/0.1.0/webuploader.withoutimage.min.js',
'/assets/admin/js/admin/user_edit.js'
))); ?>
